#ifndef __GUI_VIEW_H
#define __GUI_VIEW_H

#include<stddef.h>
#include<sys/list.h>
#include"gui_spirit.h"

typedef struct
{
    list_t list;
    int view;
    int real_view;
    list_t spirit_list_head;
    gui_spirit_t* spirit;
    int nowait;
}gui_view_t;

extern list_t gui_view_list_head;

#define gui_view_traversal(_view) \
        list_traversal_all_owner_to_next(_view,&gui_view_list_head,list)
#define gui_view_traversal_safe(_view,_next) \
        list_traversal_all_owner_to_next_safe(_view,_next,&gui_view_list_head,list)
#define gui_view_length()   \
        list_length(&gui_view_list_head)

int gui_view_init();
gui_view_t* gui_view_create();
int gui_view_destroy(gui_view_t* view);
void gui_view_exit();
void gui_view_add(gui_view_t* view);
void gui_view_remove(gui_view_t* view);
gui_view_t* gui_view_find(int view);







#endif 